package com.it.dbflow;

import com.raizlabs.android.dbflow.annotation.Database;
import com.raizlabs.android.dbflow.config.DatabaseDefinition;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.raizlabs.android.dbflow.structure.database.DatabaseWrapper;

@Database(version = AppDatabase.VERSION)
public class AppDatabase {

  public static final String DB_NAME ="DBflow";

  public static final int VERSION = 3;


AppDatabase(){



}

  /*@Migration(version = 2, database = AppDatabase.class)
  public static class AddEmailToUserMigration extends AlterTableMigration<User> {

    public AddEmailToUserMigration(Class<User> table) {
      super(table);
    }

    @Override
    public void onPreMigrate() {
      addColumn(SQLiteType.TEXT, "email");
    }
  }

  @Migration(version = 3, database = AppDatabase.class)
  public static class AddEmail2ToUserMigration extends AlterTableMigration<User> {

    public AddEmail2ToUserMigration(Class<User> table) {
      super(table);
    }

    @Override
    public void onPreMigrate() {
      addColumn(SQLiteType.TEXT, "email2");
    }
  }*/

public static DatabaseWrapper getDatabase(){
  DatabaseDefinition db = FlowManager.getDatabase(AppDatabase.class);

  return db.getWritableDatabase();

};



  }







